import { getBankCard } from "../../../api/bank";

Page({
  data: {bankList: [] },
  onLoad() {
    // getBankCard().then(res => {
    //   this.setData({bankList:res});
    //   let list = []
    //   for (let item in res) {
    //     list.push({
    //       text: res[item].bank_name + res[item].card_no,
    //       value: res[item].id	
    //     })
    //   }
    // })
  },
  onShow() {
    getBankCard().then(res => {
      this.setData({bankList:res});
      let list = []
      for (let item in res) {
        list.push({
          text: res[item].bank_name + res[item].card_no,
          value: res[item].id	
        })
      }
    })
  },
  addBank() {
    my.navigateTo({ url: '../bankCard/addBank/addBank' });
  },
  getImg(code) {
    return 'https://apimg.alipay.com/combo.png?d=cashier&t='+code+'_s';
  },
});
